﻿using System;

namespace 第三次课堂作业
{
    class Program
    {
        static void Main(string[] args)
        {
            ShapeFactory factory = new ShapeFactory();
            Shape s;
            double sumArea = 0;
            Random r = new Random();
            int count = 0;

            while(count != 10)
            {
                s = factory.getShape(r.Next(4));
                if (s == null)
                    continue;
                sumArea += s.Area;
                count++;
            }

            Console.WriteLine("The sum area is " + sumArea);
        }
    }
}
